<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- 引入主题样式 -->
<link href="themes/gray/easyui.css" rel="stylesheet">
<!-- 引入图标的样式 -->
<link href="themes/icon.css" rel="stylesheet">
<!-- 先引入jquery -->
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<!-- 引入easyui -->
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="js/easyui-lang-zh_CN.js"></script>
</head>
<script type="text/javascript">
$(function(){
	//构成树形
	$('#tt').tree({    
	    url:'treeData.do',
	    lines:true,
	    animate:true,
	    onLoadSuccess:function(){
	    	
	    },
		onSelect:function(node){
				var txt = node.id;
				console.log(txt)
				$.loca(txt);
		}
	    
	}); 
	//创建一个jquery方法，用来将点击的节点的id发送给servlet	
	$.loca=function(txt){
				
		location.href="index.do?tid="+txt;	
	}


});
</script>
<body class="easyui-layout">
	<div data-options="region:'west',title:'知识分类',split:true"
		style="width: 15%; border: false; ">
		<ul id="tt" >
			
		</ul>  
		</div>
	<div data-options="region:'center'"
		style="width: 85%; padding: 0px; background: #eee; border: false;">
    		<!-- 当request内置对象创建了tid属性并赋值后就跳转到type.jsp页面，否则就跳到首页index.jsp -->
    		<jsp:include page="${empty tid?'index.jsp':'type.jsp?tid=1'}"></jsp:include> 	    
		</div>
</body>
</html>